package com.gxa.hualian.pojo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * @author lijunlin
 * @date 2022/5/18
 * @Getter 给所有字段自动添加getter
 * @Setter 给所有字段自动添加setter
 * @AllArgsConstructor 自动生成全参构造
 * @NoArgsConstructor 自动生成空参构造
 */
@ApiModel
@AllArgsConstructor
@NoArgsConstructor
@Data
public class User implements Serializable {
    @ApiModelProperty(name = "id",value = "编号",dataType = "int",required = false,hidden = true)
    private Integer id;
    @ApiModelProperty(name = "name",value = "姓名",dataType = "string",required = true,example = "李抠脚")

    private String name;
    private String phone;

    @JsonFormat(pattern = "yyyy-MM-dd HH:MM:ss",timezone = "GMT+8")
    private Date regTime=new Date(System.currentTimeMillis());


    //通过List体现User和Get之间的一对多关系
    private List<String> nickNameList = new ArrayList<>();
    private List<Get> getList = new ArrayList<>();
    UserDetail userDetail;

    public User(String phone,String name,Date regTime){
        this.phone = phone;
        this.name = name;
        this.regTime = regTime;
    }
    public User(List<Get> getList){
        this.getList = getList;
    }
}
